<template>
  <div class='container'>
    <el-dialog title="预览文章" :visible.sync="logShow" width="800px">
      <div class="title">
        <h2>{{data.title}}</h2>
        <div>
          <span>{{data.createTime|parseTimeByString}}</span>
            <span>{{data.username}}</span>
            <span class="el-icon-view"></span>
            <span>{{data.visits}}</span>
        </div>
      </div>
     <div class="content" v-html="data.articleBody"></div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name:'articlesPreview',
  props:{
    data:{
      type:Object,
      default:()=>{},
    }
  },
  data(){
    return{
      logShow:false,
      title:''
    }
  },
  methods:{
    logshowPreview(){
      this.logShow=true
    }
  }
}
</script>

<style scoped lang='less'>
.title{
  border-bottom: 1px dashed #ccc;
  padding-bottom: 10px;
  h2 {
    padding: 0;
    margin: 0;
  }
  span{
    margin-left: 10px;
    margin-top: 10px;
  }
}
.content{
  background: #f5f5f5;
  padding: 10px;
}</style>
